package com.digitalchina.lxnsy.sy.all;

import android.webkit.JavascriptInterface;

import com.digitalchina.lxnsy.base.BaseHtmlActivity;
import com.digitalchina.lxnsy.sy.baoxianjilu.DetailsInsuranceRecordsActivity;
import com.digitalchina.lxnsy.sy.baoxianjilu.NewInsuranceRecordsActivity;


public class InsuranceRecordsActivity extends BaseHtmlActivity {
    private int tag = 0;

    @Override
    protected void loadHtml() {
        webView.addJavascriptObject(new JsApi(), null);

        loadUrl("insuranceRecords");
        setTitle("保险记录");
        setRightText("新增");


    }


    @Override
    public void onResume() {
        super.onResume();
        if (tag > 0) {
            callJsMethod("refresh");
        }
        tag++;

    }

    @Override
    public void rightOnClick() {

      go(NewInsuranceRecordsActivity.class);
    }


    public class JsApi {


        @JavascriptInterface
        public void detailsInsuranceRecords(Object msg) {
            go(DetailsInsuranceRecordsActivity.class);

        }




    }
}
